cmake_minimum_required(VERSION 3.10)

# 项目名称
project(dfc_det_ncnn)

# 编译参数
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ")
set(CMAKE_CXX_FLAGS "-std=c++0x -Wno-deprecated")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
set(CMAKE_BUILD_TYPE Debug)

# option(NCNN_OPENMP "openmp support" OFF)
FIND_PACKAGE(OpenMP)

if(OPENMP_FOUND)
    message("OPENMP FOUND")
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()

set(OPENCV_LIBS -lopencv_core -lopencv_features2d -lopencv_highgui -lopencv_imgproc -lopencv_ml -lopencv_imgcodecs)

# include path
include_directories(/usr/include)
include_directories(/usr/include/ncnn)
include_directories(/home/using/ncnn/build/src)
include_directories(${CMAKE_SOURCE_DIR}/include)

set(NCNN_LIB /home/using/ncnn/build/src/libncnn.a)

# LINK_LIBRARIES(uuid)
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})

add_executable(dfc_det main.cpp src/dfc_det.cpp )
target_link_libraries(dfc_det dl ${NCNN_LIB} ${OpenCV_LIBS})
